for x in range( cmds.playbackOptions( aet = 1 , q=1 ) ):
    cmds.currentTime( x )
    for x in ['lf','rt']:
        for y in ['ft','md','bk']:
            mat = cmds.getAttr( 'ant_'+x+y+'_null.worldMatrix' )
            cmds.xform( 'ant_'+x+y+'_ctrl' , m=mat )
            cmds.setKeyframe( 'ant_'+x+y+'_ctrl' , at='translateX' )
            cmds.setKeyframe( 'ant_'+x+y+'_ctrl' , at='translateZ' )
            cmds.setKeyframe( 'ant_'+x+y+'_ctrl' , at='rotateY' )
            
for iAnt in cmds.ls('ant_all*' , tr=1):
    ant = getHich(iAnt)
    for x in range( cmds.playbackOptions(q=1,aet=1)):
        cmds.currentTime(x+1) 
        antwalk(ant)
        for lg in ant['legs']:
            cmds.setKeyframe( lg ,at='translateY' )